# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI="4"

inherit eutils subversion

DESCRIPTION="PoDoFoBrowser is a Qt application for browsing the objects in a PDF file and modifying their keys easily."
HOMEPAGE="http://podofo.sourceforge.net/index.html"
ESVN_REPO_URI="http://svn.code.sf.net/p/podofo/code/podofobrowser/trunk"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="app-text/podofo
        dev-qt/qtcore:4
        >=dev-util/cmake-2.4.4"

RDEPEND=""

pkg_setup() {
    rm -r "${ESVN_STORE_DIR}/${PN}" # svn update failure workaraund
}

src_compile() {
    cmake \
        -DLIBPODOFO_DIR=/usr \
        -DCMAKE_INSTALL_PREFIX:PATH=/usr \
        -DCMAKE_C_FLAGS="${CFLAGS}" \
        || die "cmake failed"
    make || die "compile failed"
}

src_install() {
    emake DESTDIR=${D} install || die 'Install Failed'
    dodoc AUTHORS INSTALL README TODO
    newicon "${PN}.svg" "${PN}.svg"
    make_desktop_entry ${PN} "PoDoFoBrowser" ${PN} "Graphics" || die "desktop file sed failed"
}
